﻿using Autofac;

namespace MovieDB.Autofac
{
    public static class AutofacResolver
    {
        private static IContainer _container;


        public static void SetResolver(IContainer container)
        {
            _container = container;
        }

        public static T Resolve<T>()
        {
            return _container.Resolve<T>();
        }

        public static T ResolveByName<T>(string name)
        {
            return _container.ResolveNamed<T>(name);
        }

        public static TService ResolveByKey<TService>(object key)
        {
            return _container.ResolveKeyed<TService>(key);
        }
    }
}